#ifndef _C_LIST_H
#define _C_LIST_H
#include <stdlib.h>
#include <stdbool.h>

typedef struct ListNode{
	void* data;
	struct ListNode* next;
	struct ListNode* prev;
}ListNode,Node;

typedef struct List{
	ListNode* head;
}List;

ListNode* ConstructListNode();
void DestructListNode(ListNode* node);
List* ConstructList();
void DestructList(List* ls);
bool InitList(List* ls);
void ReleaseList(List* ls);
bool ExistNode(List* ls,ListNode* node);
void PushFront(List* ls,void* data);
void PushBack(List* ls,void* data);
void Push(List* ls,ListNode* pos,void* data);
void PopFront(List* ls);
void PopBack(List* ls);
void* Front(List* ls);
void* Back(List* ls);
ListNode* Begin(List* ls);
ListNode* End(List* ls);
ListNode* RBegin(List* ls);
ListNode* REnd(List* ls);
bool Empty(List* ls);
unsigned int Length(List* ls);
void Clear(List* ls);

#endif
